
var fs = require('fs')
module.exports = async function imagesBase64(filePath){
	return new Promise((resolve)=>{
		fs.readFile('./'+filePath, function(err, origin_buffer) {
			console.log(Buffer.isBuffer(origin_buffer))
			var base64Image = origin_buffer.toString('base64');
			// let uri = `data:image/png;base64,${base64Image}`
			// console.log(uri);
			resolve(base64Image);
			// var decodedImage = new Buffer(base64Image,'base64');
			// fs.writeFile('logo_decoded.png',decodedImage,function (err) {
			//     if (err)
			//         console.log(err);
			// })
		})
	})
}
